package main

import (
    "github.com/robfig/cron"
    "log"
	"net/http"
)

func main() {
    i := 0
    c := cron.New()
	//秒  分 时 日 月 星期
    spec := "0 */3 * * * ?"
    c.AddFunc(spec, func() {
        res,_ := http.Get("http://hlbtest/index.php/Api/Timer/guessIndex")
        defer res.Body.Close()
	
		i++
        log.Println("cron running:", i)
    })
    c.Start()
    
    select{}
}